package com.xlabs.client.shared;

import java.util.List;

import com.google.gwt.requestfactory.shared.InstanceRequest;
import com.google.gwt.requestfactory.shared.Request;
import com.google.gwt.requestfactory.shared.RequestContext;
import com.google.gwt.requestfactory.shared.Service;
import com.xlabs.server.DO.Question;

@Service(Question.class)
public interface QuestionRequest extends RequestContext
{
	/**
	* @return a request object
	*/
	Request<QuestionProxy> findQuestion(String id);
	
	/**
	 * Gets questions asked based on start time index for a video.
	 * @param videoId given video id.
	 * @param startTimeIndexIncl interval start.
	 * @param endTimeIndexExcl interval end.
	 * @param direction specifies the direction of query.  
	 * @param pageSize how many questions to return. 
	 * @return transfer object including the questions.
	 */
    Request<List<QuestionProxy>> getQuestionsByStartTimeIndex(
    		String videoId, 
    		String startTimeIndexIncl, 
    		String endTimeIndexExcl, 
    		int direction, 
    		int pageSize);
	  
	/**
	* @return a request object
	*/
	InstanceRequest<QuestionProxy, Void> persist();
	
	/**
	* @return a request object
	*/
	InstanceRequest<QuestionProxy, Void> remove();
}
